﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


public class Utility
{
	public Utility()
	{

	}

    //     System.Diagnostics.Debug.WriteLine(url);
    //     Response.Write(" class=\"active\" ");

    public static String currentPage() {
        String url = HttpContext.Current.Request.Url.AbsoluteUri;
        String[] tmp = url.Split('/');
        if (tmp.Count() != null)
        {
            String prova = tmp[tmp.Count() - 1];
            String[] pages = prova.Split('.');
            String pagina = pages[0];
            return pagina;
        }
        else

        return "index";
    }

    public static void checkLogin(){
        if (HttpContext.Current.Session["islogged"]==null )
        {
            System.Web.HttpContext.Current.Response.Redirect("/FORUMDEFINITIVO/index.aspx");
        }

    }
}